﻿namespace AltNetUK
{
    using System;
    using System.Collections.Generic;
    using AltNetUK.Models;
    using SimpleWebServices.Data;

    public class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Recalculating ETag values:");

            IList<Availability> availabilities = Repository.Query<Availability>("/availability");
            foreach (Availability availability in availabilities)
            {
                Console.WriteLine("\tAvailability " + (availability as IPersistable).Identifier);
                Repository.Update(availability);
            }

            IList<Registration> registrations = Repository.Query<Registration>("/registration");
            foreach (Registration registration in registrations)
            {
                Console.WriteLine("\tRegistration " + (registration as IPersistable).Identifier);
                Repository.Update(registration);
            }

            Console.WriteLine(string.Empty);
            Console.WriteLine("Complete.");
        }
    }
}